<?php

namespace App\Models\Factory\V0;


use App\Models\AbsModelFactory;
use App\Models\Orm\V0\User;


/**
 * @file PasswordFactory.php
 * @brief 密码工厂
 * @author 
 * @version 2.*
 * @date 2017-11-25
 */
class PasswordFactory extends AbsModelFactory
{

	/**
	 * @brief setPassword 设置用户密码
	 *
	 * @param $token
	 * @param $password
	 *
	 * @return boolean
	 */
    public static function setPassword($token,$password)
    {
        $data['password'] = $password;
        $result = User::where('token',$token)->update($data);
        return $result ? true : false;
    }
}
